/**
 * 创建文件li
 * @param {数据item} item 
 */
function createFileContent(item) {
    var file = "\
        <div class='file {type}'>\
            <div class='graphical'>\
                <img src='{imgPath}'>\
            </div>\
             <span title='{tip}'>{fileName}</span>\
        </div>";
    if (item.file) {
        file = file.replace("{type}", "type-file")
    } else {
        file = file.replace("{type}", "type-folder")
    }
    file = file.replace("{fileName}", item.name)
    file = file.replace("{tip}", item.name)
    file = file.replace("{imgPath}",  item.extendImage)
    return file;
}
/**
 * 
 * @param {文件夹数据} path 
 */
function createNavBtnMenu(path) {
    var menuStr = "<menu>\
        <li id='mark'>"+(currentPage=="INDEX"?"收藏":"取消收藏")+"</li>\
    </menu>";
    var $menu = $(menuStr);
    $menu.find("#mark").attr("data-path",path)
    $menu.find("#mark").click(function (events) {
        /**
         * 头部菜单点击收藏
         */
        markfile(this, currentPage=="INDEX"?true:false)
        events.stopPropagation();
    })
    return $menu;
}
/**
 * 创建导航元素
 * @param {*} name 
 * @param {*} absPath 
 */
function createNavButton(name, absPath) {
    var navBtnStr = "<button></button>";
    var $navBtn = $(navBtnStr);
    $navBtn.attr("onclick", "onNavClick(this,'" + absPath + "')");
    $navBtn.text(name)
    $navBtn.attr("absPath",absPath)
    $navBtn.attr("index", $(".file-window-header button").size() + 1)
    $navBtn.append(createNavBtnMenu(absPath))
    return $navBtn;
}